package HomeWork;
/*
1.定义一个含有五个元素的数组,并为每个元素赋值,求数组中所有元素的最小值
 */
public class Test01 {
    public static void main(String[] args) {
        int[] a = new int[5];


        //赋值
        for(int i = 0; i < a.length; i++){
            a[i] = (int)(Math.random()*100+1);
            System.out.print(a[i]+" ");
        }
        System.out.println();
        int max = a[0];

        //找最小值
        for(int i = 1; i < a.length; i++){
            if(max < a[i]){
                max = a[i];
            }
        }

        System.out.println(max);
    }
}
